import Vue from 'vue'
import Router from 'vue-router'
import config from '@/micros/config'

Vue.use(Router)

// 判断环境是否是微应用打开
let microPath = ''
if (window.__POWERED_BY_QIANKUN__) {
  microPath = config.microPath
}

const router = new Router({
  routes: [
    {
      path: microPath + '/',
      name: 'home',
      component: () => import('@/views/home.vue')
    },
    {
      path: microPath + '/download',
      name: 'download',
      component: () => import('@/views/download.vue')
    },
    {
      path: microPath + '/tools',
      name: 'tools',
      component: () => import('@/views/tools.vue')
    }
  ]
})

export default router
